package com.macro.mall.common.code.error;

/**
 * 定义通用错误码
 * Created by macro on 2019/4/19.
 */
public enum CommonErrorCode implements IErrorCode {

    VALIDATE_FAILED(401, "参数检验失败"),
    UNAUTHORIZED(402, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),

    // ===========================RSA加密算法=====================================
    NO_SUCH_ALGORITHM(405,"不支持的加密算法"),
    INVALID_KEYSPEC(406,"不支持的密钥规范"),
    NO_SUCH_PADDING(407,"不支持的密钥长度填充机制"),
    ILLEGAL_BLOCKSIZE(408,"数据的长度不符合算法的块大小要求"),
    BAD_PADDING(409,"填充机制的输入数据格式不正确"),
    INVALID_KEY(410, "密钥不适合所需的加密操作"),
    // ===========================RSA加密算法=====================================



    ;

    private long code;
    private String message;

    CommonErrorCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    public long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
